home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / debugger / ddd-1.000 / ddd-1 / ddd-1.4b / ddd / hash.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-02  |  1.4 KB  |  46 lines

  1. // $Id: hash.h,v 1.2 1995/05/02 09:28:28 zeller Exp $ -*- C++ -*-
  2. // Hash functions
  3.  
  4. // Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
  5. // Written by Andreas Zeller (zeller@ips.cs.tu-bs.de).
  6. // 
  7. // This file is part of the ICE Library.
  8. // 
  9. // The ICE Library is free software; you can redistribute it and/or
  10. // modify it under the terms of the GNU Library General Public
  11. // License as published by the Free Software Foundation; either
  12. // version 2 of the License, or (at your option) any later version.
  13. // 
  14. // The ICE Library is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. // See the GNU Library General Public License for more details.
  18. // 
  19. // You should have received a copy of the GNU Library General Public
  20. // License along with the ICE Library -- see the file COPYING.LIB.
  21. // If not, write to the Free Software Foundation, Inc.,
  22. // 675 Mass Ave, Cambridge, MA 02139, USA.
  23. // 
  24. // ICE is the incremental configuration engine.
  25. // Contact ice@ips.cs.tu-bs.de for details.
  26.  
  27. #ifndef _ICE_hash_h
  28. #define _ICE_hash_h
  29.  
  30. #ifdef __GNUG__
  31. #pragma interface
  32. #endif
  33.  
  34. unsigned int hashpjw(const char*);
  35.  
  36. inline unsigned int multiplicativehash(int x)
  37. {
  38.     // uses a const close to golden ratio * pow(2,32)
  39.     return ((unsigned)x) * 2654435767;
  40. }
  41.  
  42. unsigned int foldhash(double);
  43.  
  44. #endif // _ICE_hash_h
  45. // DON'T ADD ANYTHING BEHIND THIS #endif
  46.